package alkaid.oss.minio.util;


import alkaid.oss.common.util.Helper;
import cn.hutool.core.lang.Assert;
import lombok.experimental.UtilityClass;

/**
 * 工具
 *  
 * @author Lucky Yang
 * @since 0.0.1
 */
@UtilityClass
public class MinioUtils {
    public static final String PATH_SEP = "/";

     /**
     * 生成Minio的对象ID，包含两级目录结构
     * @param objectId
     * @return
     */
    public String minioId(final String objectId) {
        Assert.notBlank(objectId);

        String[] paths = Helper.generalHashPath(objectId); 
        return String.join(PATH_SEP, paths) + PATH_SEP + objectId;
    }   
}
